package ua.com.abakumov.android.prostopleer

import android.util.Log
import android.preference.PreferenceManager
import java.io.File
import android.os.Environment
import android.app.{Application => AndroidApp}


/**
 * Class
 * User: alex
 * Date: 12/2/12
 * Time: 6:48 PM
 */
class ProstoPleerApplication extends AndroidApp {

  override def onCreate() {
    Log.i("ProstoPleer.com", "Applications is being started")
    super.onCreate()

    initPreferences
  }

  private def initPreferences {
    val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)

    val downloadDirectory: File = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
    sharedPreferences.edit().putString(AppConstants.DOWNLOAD_DIRECTORY, downloadDirectory.toString).commit()
  }
}
